<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册账户 - USDTMarket</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        success: '#36D399',
                        danger: '#F87272',
                        dark: '#1E293B',
                        light: '#F1F5F9',
                        'dark-blue': '#0F172A',
                        'light-blue': '#E0E7FF',
                    },
                    fontFamily: {
                        inter: ['Inter', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-hide {
                -ms-overflow-style: none;
                scrollbar-width: none;
            }
            .scrollbar-hide::-webkit-scrollbar {
                display: none;
            }
            .glass {
                background: rgba(255, 255, 255, 0.2);
                backdrop-filter: blur(10px);
                -webkit-backdrop-filter: blur(10px);
            }
            .card-hover {
                transition: all 0.3s ease;
            }
            .card-hover:hover {
                transform: translateY(-3px);
                box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
            }
            .password-strength-0 { width: 0%; }
            .password-strength-1 { width: 25%; background-color: #F87272; }
            .password-strength-2 { width: 50%; background-color: #FBBD23; }
            .password-strength-3 { width: 75%; background-color: #3ABFF8; }
            .password-strength-4 { width: 100%; background-color: #36D399; }
        }
    </style>
</head>
<body class="font-inter bg-gradient-to-br from-dark-blue to-dark min-h-screen text-light">
    <!-- 导航栏 -->
    <header class="fixed top-0 left-0 right-0 z-50 transition-all duration-300" id="navbar">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between glass border-b border-white/10">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                    <i class="fa fa-exchange text-white text-xl"></i>
                </div>
                <h1 class="text-xl font-bold bg-gradient-to-r from-primary to-success bg-clip-text text-transparent">USDT<span class="text-sm font-normal ml-1">Market</span></h1>
            </div>
            
            <nav class="hidden md:flex items-center space-x-8">
                <a href="#" class="text-white/70 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">购买USDT</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">出售USDT</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">交易记录</a>
                <a href="#" class="text-white/70 hover:text-primary transition-colors">账户安全</a>
            </nav>
            
            <div class="flex items-center space-x-4">
                <button class="px-4 py-2 rounded-lg bg-primary text-white hover:bg-primary/90 transition-colors font-medium flex items-center justify-center gap-2">
                    <i class="fa fa-user-circle-o mr-1"></i> 登录
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="container mx-auto px-4 pt-24 pb-16 min-h-screen flex items-center justify-center">
        <div class="w-full max-w-2xl">
            <!-- 面包屑导航 -->
            <div class="mb-8 text-sm text-white/60">
                <a href="#" class="hover:text-primary transition-colors">首页</a> &gt; <span class="text-white">注册账户</span>
            </div>
            
            <div class="bg-dark-blue rounded-2xl p-8 border border-white/10 shadow-xl">
                <div class="text-center mb-8">
                    <h2 class="text-2xl font-bold mb-4">创建您的账户</h2>
                    <p class="text-white/70">填写以下信息注册成为USDTMarket用户</p>
                </div>
                
                <form id="registration-form" class="space-y-6">
                    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                        <div>
                            <label class="block text-white/70 text-sm font-medium mb-2" for="first-name">
                                名字
                            </label>
                            <input type="text" id="first-name" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入您的名字">
                            <p class="error-message text-danger text-sm mt-1 hidden">请输入您的名字</p>
                        </div>
                        
                        <div>
                            <label class="block text-white/70 text-sm font-medium mb-2" for="last-name">
                                姓氏
                            </label>
                            <input type="text" id="last-name" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入您的姓氏">
                            <p class="error-message text-danger text-sm mt-1 hidden">请输入您的姓氏</p>
                        </div>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="email">
                            电子邮箱
                        </label>
                        <input type="email" id="email" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入您的电子邮箱">
                        <p class="error-message text-danger text-sm mt-1 hidden">请输入有效的电子邮箱</p>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="phone">
                            手机号码
                        </label>
                        <div class="flex">
                            <div class="w-20 bg-dark border border-white/10 rounded-l-lg flex items-center justify-center">
                                <span>+86</span>
                            </div>
                            <input type="tel" id="phone" class="flex-1 px-4 py-3 bg-dark border-t border-b border-r border-white/10 rounded-r-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入您的手机号码">
                        </div>
                        <p class="error-message text-danger text-sm mt-1 hidden">请输入有效的手机号码</p>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="password">
                            密码
                        </label>
                        <div class="relative">
                            <input type="password" id="password" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请输入密码">
                            <button type="button" id="toggle-password" class="absolute right-3 top-1/2 -translate-y-1/2 text-white/70 hover:text-white">
                                <i class="fa fa-eye-slash"></i>
                            </button>
                        </div>
                        <p class="error-message text-danger text-sm mt-1 hidden">密码长度至少8位，包含字母和数字</p>
                        
                        <!-- 密码强度指示器 -->
                        <div class="mt-2">
                            <div class="flex justify-between text-xs text-white/60 mb-1">
                                <span>密码强度</span>
                                <span id="password-strength-text">弱</span>
                            </div>
                            <div class="h-1 bg-dark rounded-full overflow-hidden">
                                <div id="password-strength-bar" class="h-full password-strength-0 transition-all duration-300"></div>
                            </div>
                        </div>
                    </div>
                    
                    <div>
                        <label class="block text-white/70 text-sm font-medium mb-2" for="confirm-password">
                            确认密码
                        </label>
                        <input type="password" id="confirm-password" class="w-full px-4 py-3 bg-dark border border-white/10 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary text-white" placeholder="请再次输入密码">
                        <p class="error-message text-danger text-sm mt-1 hidden">两次输入的密码不一致</p>
                    </div>
                    
                    <div class="flex items-start">
                        <input type="checkbox" id="terms" class="mt-1 mr-3">
                        <label for="terms" class="text-white/70 text-sm">
                            我已阅读并同意 <a href="#" class="text-primary hover:underline">服务条款</a> 和 <a href="#" class="text-primary hover:underline">隐私政策</a>
                        </label>
                    </div>
                    <p class="error-message text-danger text-sm mt-1 hidden">请同意服务条款和隐私政策</p>
                    
                    <div>
                        <button type="submit" id="register-button" class="w-full px-6 py-3 bg-primary text-white rounded-lg hover:bg-primary/90 transition-colors font-medium flex items-center justify-center gap-2">
                            创建账户
                        </button>
                    </div>
                    
                    <div class="text-center text-white/70 text-sm">
                        已有账户？ <a href="#" class="text-primary hover:underline">立即登录</a>
                    </div>
                </form>
                
                <div class="mt-8 pt-6 border-t border-white/10">
                    <h3 class="text-center text-lg font-medium mb-4">其他注册方式</h3>
                    
                    <div class="grid grid-cols-3 gap-4">
                        <button class="p-3 bg-dark rounded-lg border border-white/10 hover:bg-white/5 transition-colors flex items-center justify-center">
                            <i class="fa fa-google text-xl"></i>
                        </button>
                        <button class="p-3 bg-dark rounded-lg border border-white/10 hover:bg-white/5 transition-colors flex items-center justify-center">
                            <i class="fa fa-facebook text-xl"></i>
                        </button>
                        <button class="p-3 bg-dark rounded-lg border border-white/10 hover:bg-white/5 transition-colors flex items-center justify-center">
                            <i class="fa fa-twitter text-xl"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark-blue border-t border-white/10">
        <div class="container mx-auto px-4 py-12">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
                <div>
                    <div class="flex items-center space-x-2 mb-4">
                        <div class="w-10 h-10 rounded-lg bg-primary flex items-center justify-center">
                            <i class="fa fa-exchange text-white text-xl"></i>
                        </div>
                        <h2 class="text-xl font-bold bg-gradient-to-r from-primary to-success bg-clip-text text-transparent">USDT<span class="text-sm font-normal ml-1">Market</span></h2>
                    </div>
                    <p class="text-white/60 mb-4">安全、便捷的USDT交易平台，支持多种本币出售，平台担保交易，保障资金安全</p>
                    <div class="flex space-x-4">
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-twitter"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-telegram"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-discord"></i>
                        </a>
                        <a href="#" class="w-8 h-8 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-primary transition-colors">
                            <i class="fa fa-github"></i>
                        </a>
                    </div>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">出售服务</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">USDT出售流程</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">设置出售价格</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">添加收款方式</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">认证卖家权益</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">提现到银行卡</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">资源中心</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">新手教程</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">安全指南</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">交易规则</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">联系客服</a></li>
                    </ul>
                </div>
                
                <div>
                    <h3 class="text-lg font-bold mb-4">法律合规</h3>
                    <ul class="space-y-2">
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">服务条款</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">风险提示</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">合规声明</a></li>
                        <li><a href="#" class="text-white/60 hover:text-primary transition-colors">知识产权</a></li>
                    </ul>
                </div>
            </div>
            
            <div class="h-px bg-white/10 my-8"></div>
            
            <div class="flex flex-col md:flex-row justify-between items-center">
                <p class="text-white/60 text-sm mb-4 md:mb-0">© 2025 USDTMarket. 保留所有权利。平台不参与任何资金交易，仅提供信息匹配服务。</p>
                <div class="flex space-x-6">
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">隐私政策</a>
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">服务条款</a>
                    <a href="#" class="text-white/60 hover:text-primary transition-colors text-sm">风险提示</a>
                </div>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 导航栏滚动效果
        const navbar = document.getElementById('navbar');
        window.addEventListener('scroll', () => {
            if (window.scrollY > 10) {
                navbar.classList.add('bg-dark-blue/90');
                navbar.classList.add('shadow-lg');
            } else {
                navbar.classList.remove('bg-dark-blue/90');
                navbar.classList.remove('shadow-lg');
            }
        });
        
        // 表单验证
        const registrationForm = document.getElementById('registration-form');
        const registerButton = document.getElementById('register-button');
        
        registrationForm.addEventListener('submit', function(e) {
            e.preventDefault();
            let isValid = true;
            
            // 验证名字
            const firstName = document.getElementById('first-name').value.trim();
            if (firstName === '') {
                showError('first-name', '请输入您的名字');
                isValid = false;
            } else {
                hideError('first-name');
            }
            
            // 验证姓氏
            const lastName = document.getElementById('last-name').value.trim();
            if (lastName === '') {
                showError('last-name', '请输入您的姓氏');
                isValid = false;
            } else {
                hideError('last-name');
            }
            
            // 验证邮箱
            const email = document.getElementById('email').value.trim();
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (!emailRegex.test(email)) {
                showError('email', '请输入有效的电子邮箱');
                isValid = false;
            } else {
                hideError('email');
            }
            
            // 验证手机号
            const phone = document.getElementById('phone').value.trim();
            const phoneRegex = /^1[3-9]\d{9}$/;
            if (!phoneRegex.test(phone)) {
                showError('phone', '请输入有效的手机号码');
                isValid = false;
            } else {
                hideError('phone');
            }
            
            // 验证密码
            const password = document.getElementById('password').value;
            const passwordRegex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/;
            if (!passwordRegex.test(password)) {
                showError('password', '密码长度至少8位，包含字母和数字');
                isValid = false;
            } else {
                hideError('password');
            }
            
            // 验证确认密码
            const confirmPassword = document.getElementById('confirm-password').value;
            if (password !== confirmPassword) {
                showError('confirm-password', '两次输入的密码不一致');
                isValid = false;
            } else {
                hideError('confirm-password');
            }
            
            // 验证服务条款
            const terms = document.getElementById('terms').checked;
            if (!terms) {
                document.querySelector('#terms + label + p').classList.remove('hidden');
                isValid = false;
            } else {
                document.querySelector('#terms + label + p').classList.add('hidden');
            }
            
            // 如果表单有效，显示加载状态并提交
            if (isValid) {
                registerButton.disabled = true;
                registerButton.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 正在注册...';
                
                // 模拟API请求延迟
                setTimeout(() => {
                    // 注册成功，跳转到登录页面
                    alert('注册成功！请登录您的账户。');
                    window.location.href = '/login';
                }, 1500);
            }
        });
        
        // 显示错误信息
        function showError(fieldId, message) {
            const field = document.getElementById(fieldId);
            const errorElement = field.nextElementSibling;
            
            if (errorElement && errorElement.classList.contains('error-message')) {
                errorElement.textContent = message;
                errorElement.classList.remove('hidden');
            }
            
            field.classList.add('border-danger');
            field.classList.remove('focus:ring-primary');
            field.classList.add('focus:ring-danger');
        }
        
        // 隐藏错误信息
        function hideError(fieldId) {
            const field = document.getElementById(fieldId);
            const errorElement = field.nextElementSibling;
            
            if (errorElement && errorElement.classList.contains('error-message')) {
                errorElement.classList.add('hidden');
            }
            
            field.classList.remove('border-danger');
            field.classList.add('focus:ring-primary');
            field.classList.remove('focus:ring-danger');
        }
        
        // 密码显示/隐藏切换
        const togglePassword = document.getElementById('toggle-password');
        const passwordInput = document.getElementById('password');
        
        togglePassword.addEventListener('click', function() {
            const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
            passwordInput.setAttribute('type', type);
            
            // 切换图标
            const icon = togglePassword.querySelector('i');
            if (type === 'password') {
                icon.classList.remove('fa-eye');
                icon.classList.add('fa-eye-slash');
            } else {
                icon.classList.remove('fa-eye-slash');
                icon.classList.add('fa-eye');
            }
        });
        
        // 密码强度检测
        const passwordStrengthBar = document.getElementById('password-strength-bar');
        const passwordStrengthText = document.getElementById('password-strength-text');
        
        passwordInput.addEventListener('input', function() {
            const password = this.value;
            let strength = 0;
            
            // 密码长度检查
            if (password.length >= 8) strength++;
            
            // 包含小写字母
            if (/[a-z]/.test(password)) strength++;
            
            // 包含大写字母
            if (/[A-Z]/.test(password)) strength++;
            
            // 包含数字
            if (/[0-9]/.test(password)) strength++;
            
            // 包含特殊字符
            if (/[^A-Za-z0-9]/.test(password)) strength++;
            
            // 更新强度指示器
            passwordStrengthBar.className = 'h-full transition-all duration-300';
            passwordStrengthBar.classList.add(`password-strength-${strength}`);
            
            // 更新强度文本
            let strengthText = '弱';
            if (strength === 2) strengthText = '中';
            else if (strength === 3) strengthText = '良好';
            else if (strength >= 4) strengthText = '强';
            
            passwordStrengthText.textContent = strengthText;
            
            // 根据强度设置文本颜色
            passwordStrengthText.className = '';
            if (strength === 1) passwordStrengthText.className = 'text-danger';
            else if (strength === 2) passwordStrengthText.className = 'text-orange-400';
            else if (strength === 3) passwordStrengthText.className = 'text-blue-400';
            else if (strength >= 4) passwordStrengthText.className = 'text-success';
        });
        
        // 输入字段获得焦点时隐藏错误
        document.querySelectorAll('input').forEach(input => {
            input.addEventListener('focus', function() {
                hideError(this.id);
            });
        });
    </script>
</body>
</html>    